#include "Common.hpp"

class Client
{
public:
    Client() : _fd(gdefaultfd)
    {
    }
    void OpenPipe(int flag)
    {
        _fd = OpenPipeHelper(flag);
        if(_fd < 0)
        {
            std::cerr<<"open error"<<std::endl;
        }
        std::cout<<"open success"<<std::endl;
    }
    void ClosePipe()
    {
        if (_fd >= 0)
            ::close(_fd);
    }

    int SendPipe(const std::string &in)
    {
        return ::write(_fd, in.c_str(), in.size());
    }
    ~Client()
    {
    }

private:
    int _fd;
}client;